-
Notifications
You must be signed in to change notification settings - Fork 3
Implement nested volumes #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
AlvaroEzq
wants to merge
16
commits into
master
Choose a base branch
from
aezq_implementNestedVolumes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To address issue #136
Currently the restG4 simulations do not accept nested volumes because TRestGeant4GeometryInfo::PopulateFromGeant4World only goes through the direct children of the world. Also, the relation between the fGdmlNewPhysicalNames (the names of the PV in the gdml) and the names of the PV inside Geant4 is done assuming that the gdml ordering of the PV is the same than the ordering of the Geant4 world daughters. This is correct when you don't have nested volumes (nested assemblies do because their children are imprinted as a regular direct children of the mother volume where the assembly is placed). When you have nested volumes, this ordering gets trickier because it depends on how you travel into the daughter volumes.
So this related PRs (#144 and rest-for-physics/restG4#141) proposes a change in the way the mapping of Geant4 PV <-> gdml pv names is done. Instead of relying in the ordering of the traversing of the daughter volumes, we will associate them by their name, which should match. Unfortunately, there are two problems:
The idea is then to traverse recursively the daughter volumes of the geometry keeping track of the path so we get the full path of the PVs with the Geant4 naming. This way we workaround the problem 1. For example we would get:
av_7_impr_1_outerGasLV_pv_2/av_6_impr_1_gasLV_pv_1/av_1_impr_1_mMBoardCopperLV_pv_11/mMBoardKapton/mMCopperFoilLayer2On the other hand, the gdml path of physical volumes positioned is in this example:
shielding/outerGas/vessel/gas/micromegasRight/mMBoardCopper/mMBoardKapton/mMCopperFoilLayer2To convert the Geant4 path to the gdml we need to replace the av_WWW_impr_XXX_YYY_ZZZ for its assemblyVolumeName/daughterPVname. The method TRestGeant4GeometryInfo::GetAlternativePathFromGeant4Path is implemented for this. The information needed for this step can be gathered in the TRestGeant4GeometryInfo::PopulateFromGdml method and saved inside members of TRestGeant4GeometryInfo, so it can be used in the method TRestGeant4GeometryInfo::PopulateFromGeant4World to convert the Geant4 paths to the gdml paths. The changes of this PR do exactly this.